Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Types #117

Merged
merged 3 commits into from
Jul 5, 2023
Merged

Fix Types #117

merged 3 commits into from
Jul 5, 2023

Conversation

ajschmidt8
Copy link
Contributor

@ajschmidt8 ajschmidt8 commented Jun 30, 2023

This PR fixes the types in index.d.ts.

Currently, the type signature for createLambdaFunction returns a type of APIGatewayProxyHandler which doesn't match its implementation.

See the source code for APIGatewayProxyHandler here:

Instead of using APIGatewayProxyHandler, I switched the return type to simply be a function which accepts a single APIGatewayProxyEvent argument and returns a Promise<APIGatewayProxyResult> type.

This change also means the unused context argument in createLambdaFunction can be removed.

@ajschmidt8
Copy link
Contributor Author

On second thought, I pushed a commit to re-add the context argument with associated types. This will be helpful in case the argument is ever used in the future.

It's not showing up on this PR yet. I am going to close and re-open this PR to see if I can get it to refresh. I assume it's an issue on GitHub's end.

@ajschmidt8 ajschmidt8 closed this Jun 30, 2023
@ajschmidt8 ajschmidt8 reopened this Jun 30, 2023
@ajschmidt8
Copy link
Contributor Author

ajschmidt8 commented Jun 30, 2023

It's not showing up on this PR yet. I am going to close and re-open this PR to see if I can get it to refresh. I assume it's an issue on GitHub's end.

that worked 🙂

@ajschmidt8
Copy link
Contributor Author

@gr2m, can you take a look at this when you have a minute?

@gr2m
Copy link
Contributor

gr2m commented Jul 5, 2023

I updated the CI so that tests should run on PRs as well now 👍🏼

Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

If you want, it would be great to add type tests using https://github.com/SamVerschueren/tsd to avoid future regressions. Up to you! This is good to merge as is

@gr2m gr2m merged commit 6a0dd6f into probot:master Jul 5, 2023
@ajschmidt8
Copy link
Contributor Author

ajschmidt8 commented Jul 5, 2023

If you want, it would be great to add type tests using https://github.com/SamVerschueren/tsd to avoid future regressions. Up to you! This is good to merge as is

Oh, that's interesting. I'll take a look at that sometime.

thanks for merging!

GitHub
Check TypeScript type definitions. Contribute to SamVerschueren/tsd development by creating an account on GitHub.

@ajschmidt8 ajschmidt8 deleted the fix-types branch July 5, 2023 18:57
@github-actions
Copy link

github-actions bot commented Jul 5, 2023

🎉 This PR is included in version 3.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants